#ifndef MSGD_GLOBAL_H
#define MSGD_GLOBAL_H 1

#include <config.h>
#include <core.h>

struct msgd_global_s {

  msgd_listening_t   *listenings;
  msgd_uint_t         listenings_n;

  msgd_connection_t  *connections;
  msgd_uint_t         connections_n; 

  msgd_event_t       *read_events;
  msgd_event_t       *write_events;

  msgd_connection_t  *free_connections;
  msgd_uint_t         free_connections_n;

  pthread_t          *worker_threads;
  msgd_uint_t         worker_threads_n;

  queue_t             reusable_connections_queue;

  pool_t             *pool;

  msgd_uint_t         processes_n;
};

msgd_int_t init_global();

#endif  //MSGD_GLOBAL_H
